﻿{template 'header', $module}
<script type="text/javascript">c(2);</script>
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
{if $MOD[pay_online]}
<td class="tab" id="action_pay"><a href="charge.php?action=pay"><span>Online Recharge</span></a></td>
<td class="tab_nav">&nbsp;</td>
{/if}
<td class="tab" id="action_card"><a href="charge.php?action=card"><span>Prepaid card recharge</span></a></td>
{if $MOD[pay_url]}
<td class="tab_nav">&nbsp;</td>
<td class="tab"><a href="{$MOD[pay_url]}"><span>Bank transfer</span></a></td>
{/if}
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="action_record"><a href="charge.php?action=record"><span>Recharge record</span></a></td>
</tr>
</table>
</div>
{if $action == 'record'}
<form action="?">
<input type="hidden" name="action" value="{$action}"/>
<div class="tt">
<select name="bank">
<option value="">Payment platform</option>
{loop $PAY $k $v}
<option value="{$k}" {if $bank == $k}selected{/if}>{$v[name]}</option>;
{/loop}
</select>
&nbsp;
{dcalendar('fromtime', $fromtime)} To {dcalendar('totime', $totime)}
&nbsp;
<input type="submit" value=" Search " class="btn"/>&nbsp;
<input type="button" value=" Reset " class="btn" onclick="Go('?action={$action}');"/>
</div>
</form>
<div class="bd">
<table cellpadding="1" cellspacing="0" class="tb">
<tr>
<th>Recharge amount</th>
<th>Recharge amount</th>
<th>Fee</th>
<th>Paid Amount</th>
<th>Payment platform</th>
<th width="130">Next single time</th>
<th width="130">Time of payment</th>
<th>状态</th>
</tr>
{loop $charges $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td height="30" class="px11">{$v[itemid]}</td>
<td class="px11">{$v[amount]}</td>
<td class="px11">{$v[fee]}</td>
<td class="px11 f_blue">{$v[money]}</td>
<td>{$PAY[$v[bank]][name]}</td>
<td class="px11 f_gray">{$v[sendtime]}</td>
<td class="px11 f_gray">{$v[receivetime]}</td>
<td>{$v[dstatus]}</td>
</tr>
{/loop}
<tr align="center">
<td height="35"><strong>小计</strong></td>
<td class="px11">{$amount}</td>
<td class="px11">{$fee}</td>
<td class="px11 f_blue">{$money}</td>
<td colspan="4">&nbsp;</td>
</tr>
</table>
</div>
<div class="pages">{$pages}</div>
<script type="text/javascript">s('charge');m('action_record');</script>
{elseif $action == 'card'}
<form method="post" action="charge.php" onsubmit="return check_card();">
<input type="hidden" name="action" value="card"/>
<table cellspacing="1" cellpadding="6" class="tb">
<tr>
<td class="tl">Card：</td>
<td class="tr"><input type="text" name="number" size="20" id="number"/> <span id="dnumber" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Password：</td>
<td class="tr"><input type="text" name="password" size="20" id="password"/> <span id="dpassword" class="f_red"></span>
</td>
</tr>
<tr>
<td class="tl"></td>
<td class="tr"><input type="submit" name="submit" value=" Recharge " class="btn"/>
</td>
</tr>
</form>
</table>
<script type="text/javascript">
function check_card() {
	if(Dd('number').value.length < 8) {
		Dmsg('Please fill in the correct recharge card number', 'number');
		return false;
	}
	if(Dd('password').value.length < 6) {
		Dmsg('Please fill in the correct password prepaid card', 'password');
		return false;
	}
}
</script>
<script type="text/javascript">s('charge');m('action_card');</script>
{elseif $action == 'pay'}
{if $MOD[pay_online]}
<form method="post" action="charge.php" onsubmit="return check();" id="dform">
<input type="hidden" name="auto" value="{$auto}"/>
<input type="hidden" name="action" value="confirm"/>
<table cellspacing="1" cellpadding="6" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> Recharge amount</td>
<td class="tr">&nbsp;
{if $charges}
{loop $charges $k $v}
<input type="radio" name="amount" value="{$v}" id="amount_{$k}"{if $k==0}checked{/if}/><label for="amount_{$k}"> {$v}{$DT[money_unit]}</label>&nbsp;
{/loop}
{else}
<input type="text" name="amount" size="10" value="{$amount}" id="amount" maxlength="8"/> {$DT[money_unit]} <span id="damount" class="f_red"></span>
{/if}
</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> Payment platform</td>
<td class="tr">
	<table cellspacing="5" cellpadding="5" class="c_p">
	{php $i=0;}
	{loop $PAY $k=>$v}
	{if $v[enable]}
	<tr onclick="Dd('{$k}').checked=true;">
	<td><input type="radio" name="bank" value="{$k}" id="{$k}"{if $i==0} checked{/if}/></td>
	<td><img src="{DT_STATIC}file/image/logo_{$k}.gif" alt=""/></td>
	<td>Fee {$v[percent]}%</td>
	</tr>	
	{php $i=1;}
	{/if}
	{/loop}
	{if $i==0}
	<tr>
	<td class="f_red"><br/>Sorry, but the system is not set up payment platform, temporarily unable to recharge online</td>
	</tr>
	{/if}
	</table><br/><span id="dbank" class="f_red"></span>
</td>
</tr>
<tr>
<td class="tl" height="50"> </td>
<td class="tr"><input type="submit" value=" Next " class="btn"{if $i==0} disabled{/if}/></td>
</tr>
</table>
</form>
{/if}
<script type="text/javascript">
function check() {
{if !$charges}
	if(!Dd('amount').value) {
		Dmsg('Please fill out the recharge amount', 'amount');
		return false;
	}
{if $mincharge}
	if(Dd('amount').value < {$mincharge}) {
		Dmsg('Minimum amount{$mincharge}', 'amount');
		return false;
	}
{/if}
{/if}
}
{if $auto}Dd('dform').submit();{/if}
</script>
<script type="text/javascript">s('charge');m('action_pay');</script>
{elseif $action == 'confirm'}
<form method="post" action="charge.php" id="dform">
<input type="hidden" name="goto" value="1"/>
<input type="hidden" name="action" value="confirm"/>
<input type="hidden" name="amount" value="{$amount}"/>
<input type="hidden" name="bank" value="{$bank}"/>
<table cellspacing="1" cellpadding="6" class="tb">
<tr>
<td class="tl">Payment platform</td>
<td class="tr"><img src="{DT_STATIC}file/image/logo_{$bank}.gif" alt=""/></td>
</tr>
<tr>
<td class="tl">Recharge amount</td>
<td class="tr">&nbsp;<strong>{$amount}</strong> {$DT[money_unit]}</td>
</tr>
<tr>
<td class="tl">Fee</td>
<td class="tr">&nbsp;<strong>{$fee}</strong> {$DT[money_unit]}</td>
</tr>
<tr>
<td class="tl">Paid Amount</td>
<td class="tr">&nbsp;<strong class="f_red">{$charge}</strong> {$DT[money_unit]}</td>
</tr>
<tr>
<td class="tl">Tips</td>
<td class="tr f_gray">
&nbsp;- Click OK to recharge, the system will jump to the third-party payment platform, after the success of the system will pay for you automatically credited.<br/>
&nbsp;- If you encounter any problems during the payment, please get in touch with the customer service center for timely processing.<br/>
</td>
</tr>
<tr>
<td class="tl"> </td>
<td height="50" class="tr">
<input type="submit" value=" Confirm recharge " class="btn"/> &nbsp;
<input type="button" value=" Return to modify " class="btn" onclick="history.back(-1);"/>
</td>
</tr>
</table>
</form>
{if $auto}<script type="text/javascript">Dd('dform').submit();</script>{/if}
<script type="text/javascript">s('charge');m('action_pay');</script>
{else}
<table cellspacing="1" cellpadding="6" class="tb">
{if $charge_status == 2}
<tr>
<td class="tl">Recharge Results</td>
<td class="tr f_red f_b px14">×Abnormal recharge</td>
</tr>
<tr>
<td class="tl" height="50">v</td>
<td class="tr lh18">
- Error Codes“{$charge_errcode}”，Please contact<a href="ask.php?action=add" class="b">Contact customer service </a> and the error code。<br/>
- <a href="charge.php?action=pay" class="b">Click here reloads。</a><br/>
</td>
</tr>
{elseif $charge_status == 1}
<tr>
<td class="tl">Recharge Results</td>
<td class="tr f_green f_b px14">√ Successful recharge, recharge your account has <span class="f_red">{$charge_amount}</span> {$DT[money_unit]}</td>
</tr>
<tr>
<td class="tl" height="50">v</td>
<td class="tr lh18">
- <a href="record.php?action=charge" class="b">Query log, please click here。</a><br/>
- <a href="charge.php?action=pay" class="b">Click here to continue to recharge。</a><br/>
</td>
</tr>
{else}
<tr>
<td class="tl" height="50">Recharge Results</td>
<td class="tr f_red f_b px14">
×Recharge failure
</td>
</tr>
<tr>
<td class="tl" height="50">Instructions</td>
<td class="tr lh18">
- v<a href="ask.php?action=add" class="b">Contact Customer Service</a>Solve。<br/>
- <a href="charge.php?action=pay" class="b">Click here reloads。</a><br/>
</td>
</tr>
{/if}
</table>
{if $charge_forward}<script type="text/javascript">setTimeout(function(){Go('{$charge_forward}');}, 2000);</script>{/if}
<script type="text/javascript">s('charge');m('action_pay');</script>
{/if}
{template 'footer', $module}